package com.wt.springboot.controller;

import com.wt.springboot.bean.Employee;
import com.wt.springboot.model.ResponseResult;
import com.wt.springboot.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * Created with IDEA
 * Describe:
 * Author:TianJi
 * Date:2018/11/8
 * Time:13:42
 */
@Controller
public class EmployeeController {
    @Autowired
    private EmployeeService employeeService;

    @GetMapping("/emp/{id}")
    @ResponseBody
    public ResponseResult getEmployeeById(@PathVariable("id") Integer id){
        Employee employee = employeeService.getEmployeeById(id);
        return ResponseResult.build(0,"success",employee);
    }
    @PutMapping("/emp/")
    @ResponseBody
    public void updateEmployee(Employee employee){

    }

    public void addEmployee(Employee employee){

    }

    public void deleteEmployee(Integer id){

    }
}
